export default function request(pathname: string, options = {}) {
    return new Promise((resolve: (value: ApiResponse) => void, reject) => {
            fetch(pathname, options).then((data) => {
                return data.json();
            })
                .then((responseText) => {
                    resolve(responseText)
                })
                .catch((error) => {
                    reject(error)
                });

        }
    )
}